Skip to content

TST: Don't use 'is' on strings to avoid SyntaxWarning #33322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 6, 2020

Conversation

rebecca-palmer
Copy link
Contributor

This avoids the below warning (in Python 3.8, user-visible in Debian because they byte-compile everything on install), and possibly unspecified behaviour (though I haven't seen that in practice).

  /usr/lib/python3/dist-packages/pandas/tests/frame/test_alter_axes.py:241: SyntaxWarning: "is" with a literal. Did you mean "=="?
    False if (keys[0] is "A" and keys[1] is "A") else drop  # noqa: F632

@jreback jreback added Compat pandas objects compatability with Numpy or Python functions Testing pandas testing functions or related to the test suite labels Apr 6, 2020
@jreback jreback added this to the 1.1 milestone Apr 6, 2020
@jreback jreback merged commit 66a3d17 into pandas-dev:master Apr 6, 2020
@jreback
Copy link
Contributor

jreback commented Apr 6, 2020

thanks @rebecca-palmer

jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Apr 11, 2020
raspbian-autopush pushed a commit to raspbian-packages/pandas that referenced this pull request May 10, 2020
It causes a SyntaxWarning on install, and possibly undefined test results

Author: Rebecca N. Palmer <[email protected]>
Bug-Debian: https://bugs.debian.org/956021
Forwarded: pandas-dev/pandas#33322


Gbp-Pq: Name fix_is_warnings.patch
raspbian-autopush pushed a commit to raspbian-packages/pandas that referenced this pull request Jul 2, 2020
It causes a SyntaxWarning on install, and possibly undefined test results

Author: Rebecca N. Palmer <[email protected]>
Bug-Debian: https://bugs.debian.org/956021
Forwarded: pandas-dev/pandas#33322


Gbp-Pq: Name fix_is_warnings.patch
raspbian-autopush pushed a commit to raspbian-packages/pandas that referenced this pull request Aug 20, 2020
It causes a SyntaxWarning on install, and possibly undefined test results

Author: Rebecca N. Palmer <[email protected]>
Bug-Debian: https://bugs.debian.org/956021
Forwarded: pandas-dev/pandas#33322


Gbp-Pq: Name fix_is_warnings.patch
raspbian-autopush pushed a commit to raspbian-packages/pandas that referenced this pull request Aug 31, 2020
It causes a SyntaxWarning on install, and possibly undefined test results

Author: Rebecca N. Palmer <[email protected]>
Bug-Debian: https://bugs.debian.org/956021
Forwarded: pandas-dev/pandas#33322


Gbp-Pq: Name fix_is_warnings.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants